import AxiosIns from '/src/axios/axios.js'

const Category = "Category/Category.php?s="

/**
 * 邮箱注册
 * @param {*} params 
 * @returns 
 */
export function email_rigster(params) {
    return AxiosIns({
        method:'post',
        url:'User/User.php?s=emailRegister',
        data:params
    })
}

/**
 * 获取邮箱验证码
 * @param {*} addAddress 
 * @returns 
 */
export function get_email_code(addAddress) {
    return AxiosIns({
        method:'post',
        url:'Email/Email.php?s=emailRegister',
        headers:{
            smskey:"855228c94ac52c829b26b7a7317b8d91e04cb1de"
        },
        data:{
            addAddress
        }
    })
}


/**
 * 登录
 * @param {*} params 
 * @returns 
 */
export function login(params) {
    return AxiosIns({
        method:'post',
        url:'User/User.php?s=login',
        data:params
    })
}

/**
 * 书签分类
 * @param {*} params 
 * @returns 
 */
export function bookCategory(params) {
    return AxiosIns({
        method:'get',
        url:Category+'getAll',
        data:params
    })
}

/**
 * 添加书签分类
 * @param {*} params 
 * @returns 
 */
export function addCategory(params) {
    return AxiosIns({
        method:'post',
        url:Category+'addCategory',
        data:params
    })
}

/**
 * 删除书签分类
 * @param {*} params 
 * @returns 
 */
export function deleteCategory(classId) {
    return AxiosIns({
        method:'post',
        url:Category+'deleteCategory',
        params:{
            classId
        }
    })
}

/**
 * 修改书签分类
 * @param {*} params 
 * @returns 
 */
export function amendCategory(params) {
    return AxiosIns({
        method:'post',
        url:Category+'amendCategory',
        data:params
    })
}